package com.zhang.boot.core.constants;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.time.Duration;

@ConfigurationProperties(prefix = "spring.redis")
@Component
@Data
public class RedisConstant {
    private String host;
    private int port;
    private String password;
    private Duration timeout;

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login:token:";
    public static final String LOGIN_CAPTCHA_PREFIX = "login:captcha:";
    public static final String CAPTCHA_CODE_PREFIX = "captcha:code:";
    public static final int CAPTCHA_CODE_EXPIRATION = 2;
}
